package com.blb.thread;

public class Demo4Priority {

    public static void main(String[] args) {
        Thread thread1=new Thread(()->{
            for(int i=0;i<10;i++){
                System.out.println(Thread.currentThread().getName()+"------>"+i);
            }
        });
        thread1.setName("张三");
        thread1.setPriority(Thread.MIN_PRIORITY);
        thread1.start();

        Thread thread2 = new Thread(()->{
            for(int i=0;i<10;i++){
                System.out.println(Thread.currentThread().getName()+"----->"+i);
            }
        });
        thread2.setName("李四");
        thread2.setPriority(Thread.MAX_PRIORITY);
        thread2.start();
    }
}
